home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5826 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.8 KB

  1. Path: magnus.acs.ohio-state.edu!csn!ub!newserve!rebecca!rpi!not-for-mail
  2. From: Jacek Surazski <jaceks@stud.unit.no>
  3. Newsgroups: comp.lang.c++,comp.lang.c++.moderated
  4. Subject: Q: stack corrupted before main()?
  5. Date: 6 Feb 1996 17:44:35 -0000
  6. Organization: The Norwegian University of Science and Technology
  7. Sender: cppmods@netlab.cs.rpi.edu
  8. Approved: vandevod@cs.rpi.edu
  9. Message-ID: <4f8423$kp9@netlab.cs.rpi.edu>
  10. NNTP-Posting-Host: netlab.cs.rpi.edu
  11. X-Original-Date: 6 Feb 1996 16:41:58 GMT
  12.  
  13. The project I am currently working on is exhibiting the following behavior: the
  14. stack is corrupted even before control enters main(). That is, when I run it
  15. under a debugger and view the stack, it shows names of non-existent functions
  16. even as the control pointer is still on the main() header. If I try to step
  17. through the program, the stack shows new non-existant, and occasionally
  18. existant but incorrect functions, whenever I step into a function in the code.
  19.  
  20. The project is written for dos, and I am using bc 3.1. I've tried to "boil
  21. down" the problem to as small a piece of code as possible, but it proved a bit
  22. bewildering, as no single chunk appeared to be responsible. Removing
  23. miscelenous bits from here and there seemed to allivate the problem, but these
  24. bits apparently had nothing in common. I have come to the conclusion, that
  25. perhaps this is a configuration problem?
  26.  
  27. I am quite confident that the stack is corrupted before any code (or rather MY
  28. code) is exectued. I do not, for example, have any global instances of classes,
  29. whose constructors would be executed before main().
  30.  
  31. In view of all this I am at a loss what info I could include to make a
  32. diagnosis easier. The best I can do is to say that the project has a rather
  33. rich class tree, in which I exploit much virtual inheritence, multiple
  34. inheritence and abstract classes. Ofcourse, a lot of the methods are virtual.
  35. Upon this tree I've built a few template classes, which also employ virtual
  36. functions.
  37.  
  38. The only aspect of this project that differs from ones I've completed
  39. previously, I guess, is that I have a class which all the methods are inline,
  40. ie. it's completely contained in a .h file. I could find no documentation that
  41. would say that this is a problem. Is it?
  42.  
  43. If anyone had simmilar problems, or if someone knows of a configuration option
  44. that might be responsible for this, I'd much appreciate hearing from them.
  45.  
  46. --------------------------------------
  47. Jacek Surazski
  48. email: jaceks@stud.unit.no
  49. www:   http://www.stud.unit.no/~jaceks
  50. --------------------------------------
  51.  
  52.       [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
  53.       [  Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm  ]
  54.       [  Moderation policy: http://www.connobj.com/cpp/guide.htm  ]
  55.       [      Comments? mailto:c++-request@netlab.cs.rpi.edu       ]
  56.